<template>
  <a-spin :spinning="loadingGlobal">
    <a-row>
      <!-- {{activityList}}
    <br>    <br> -->
      <!-- currentItem：{{currentItem}}
    <br/>
    configInfo:{{configInfo}} -->
      <!--   @change="changeStep"  -->
      <a-steps class="steps" :current="currentItem.index">
        <!--  :disabled=" index > sectionDetail.currentItemIndex" -->
        <a-step
          @click="stepChange(index)"
          :key="item.id + item.isSummary"
          :status="stepStatus(item, index)"
          v-for="(item, index) in activityList"
          :title="item.businessName"
        >
          <!-- <span slot="subTitle">
          <span>
          {{ item.completeStatus == '1' ? '已设置' : '未设置' }}
          </span>
        </span> -->
          <span slot="description" v-if="item.completeFlag"> 设置完成时间：{{ item.completeTime || '' }} </span>
        </a-step>
      </a-steps>
    </a-row>
    <a-row style="text-align: right">
      <a-button
        v-if="groupFlag && (!(completeFlag && lastFlag) || !completeFlag) && !lastFlag"
        type="primary"
        @click="changeNext"
        style="margin-left: 20px"
      >
        下一步</a-button
      >
      <a-button v-if="groupFlag && allCompleted" type="primary" @click="showScoreList" style="margin-left: 20px">
        完成评标</a-button
      >
    </a-row>
    <a-row type="flex" :span="4" style="margin-top: 20px">
      <a-col flex="200px">
        <a-card :head-style="{ padding: 0 }" :body-style="{ padding: '5px' }">
          <a-list :loading="loading" item-layout="horizontal" :data-source="tenderListData">
            <a-list-item slot="renderItem" slot-scope="item, index">
              <a slot="actions" @click="downloadFile(item.pdfUrl)">下载</a>
              <a-list-item-meta description="">
                <a slot="title" :class="[selectTenderId == item.id ? 'selected' : '']" @click="onSelectTender(item)"
                  >{{ item.bidderName }}
                  <a-icon type="check" v-if="item.completeStatus" style="margin-top: 5px; float: right"
                /></a>
              </a-list-item-meta>
            </a-list-item>
          </a-list>
        </a-card>
        <br/>
        <a-card title="未通过">
          <a-list :loading="loading" item-layout="horizontal" :data-source="rejectTenderList">
            <a-list-item slot="renderItem" slot-scope="item, index">
              <a-list-item-meta description="">
                <a slot="title" :class="[selectTenderId == item.id ? 'selected' : '']" @click="onSelectTender(item)"
                  >{{ item.bidderName }}
                  <a-icon type="check" v-if="item.completeStatus" style="margin-top: 5px; float: right"
                /></a>
              </a-list-item-meta>
            </a-list-item>
          </a-list>
        </a-card> 
        <a-card title="文件特征码" style="margin-top:5px;font-size:14px;" >
          <a-row>
            <a-col :span="24">CA硬件特征码： {{ cardInfo.cardNo }} </a-col>
            <a-col :span="24"> CPU型号：{{ cardInfo.cpu }} </a-col>
            <a-col :span="24"> ip地址： {{ cardInfo.ip }} </a-col>
            <a-col :span="24"> mac地址： {{ cardInfo.mac }} </a-col>
            <a-col :span="24"> 硬盘型号： {{ cardInfo.hardDisk }} </a-col>
            <a-col :span="24"> 主板型号： {{ cardInfo.motherboard }} </a-col>
            <a-col :span="24"> 网卡型号： {{ cardInfo.netCard }} </a-col>
          </a-row>
        </a-card>
      </a-col>
      <a-col flex="10px">
      </a-col>
      <a-col flex="auto" >
        <a-card :title="selectTenderName">
          <template #extra>
            <template v-if="disabledBtn">
              <a-button v-if="!completeFlag && currentItem.isSummary == 0" type="primary" @click="submit">
                完成
              </a-button>
            </template>
            <a-button
              v-if="currentItem.isSummary == 1 && !configInfo.completeStatus"
              type="primary"
              @click="showSummarySubmit"
              >汇总完成</a-button
            >
            <a-button
              v-if="groupFlag && currentItem.isSummary == 0"
              type="primary"
              @click="showExpertPingBiaoRecord"
              style="margin-left: 20px"
            >
              评标记录</a-button
            >
            <a-button v-if="groupFlag" type="primary" @click="showRollBackModal" style="margin-left: 20px">
              回退</a-button
            >
            <a-button type="primary" @click="refresh" style="margin-left: 20px">刷新</a-button>
            <!-- 完成评标需要加状态限制 -->
          </template>
          <a-row :gutter="10" style="margin-top: 20px">
            <template v-if="currentItem.isSummary">
              <ExpertProgressTable :business-id="currentItem.id" :section-id="sectionId" />
              <!--              <PfTenderDetail
                v-if="currentItem.type == 1"
                :currentItem="currentItem"
                :tenderId="selectTenderId"
                :realBusinessId="currentItem.businessId"
              />
              <FhxExpertDetail
                v-if="currentItem.type == 2"
                :bidSectionId="sectionId"
                :tenderListId="selectTenderId"
                :businessId="currentItem.businessId"
              />-->
            </template>
            <template v-else>
              <a-col v-if="currentItem.type == 1">
                <a-tabs v-model="activeKey" type="card">
                  <a-tab-pane key="1" tab="综合指标"> </a-tab-pane>
                  <a-tab-pane key="2" tab="技术指标"> </a-tab-pane>
                </a-tabs>
                <score
                  v-show="activeKey == '1'"
                  :completeFlag="completeFlag"
                  @submit="submit"
                  ref="score1Ref"
                  :currentItemId="currentItem.id"
                  :entryId="currentItem.businessId"
                  :standardType="'综合指标'"
                  :disabled="true"
                  :expertId="userInfo.id"
                  :tenderId="selectTenderId"
                ></score>
                <score
                  v-show="activeKey == '2'"
                  :completeFlag="completeFlag"
                  @submit="submit"
                  ref="score2Ref"
                  :currentItemId="currentItem.id"
                  :entryId="currentItem.businessId"
                  :standardType="'技术指标'"
                  :disabled="true"
                  :expertId="userInfo.id"
                  :tenderId="selectTenderId"
                ></score>
              </a-col>
              <!-- <a-col v-if="currentItem.type == 1" :span="18">
            {{ reviewItemList }}
          </a-col> -->
              <a-col v-else :span="24">
                <a-button v-if="!completeFlag" type="primary" @click="selectTable(1)" style="margin-left: 20px">
                  全部符合</a-button
                >
                <a-button v-if="!completeFlag" @click="selectTable(0)" style="margin-left: 20px"> 全部不符合</a-button>
                <a-table
                  :scroll="{ x: 1200 }"
                  rowKey="id"
                  bordered
                  size="middle"
                  :columns="columns"
                  :dataSource="reviewItemList"
                  :pagination="false"
                >
                  <div slot="action" slot-scope="text, record">
                    <a-radio-group :disabled="completeFlag" name="tenantStatus" v-model="record.score">
                      <a-radio :value="1">符合</a-radio>
                      <a-radio :value="0">不符合</a-radio>
                    </a-radio-group>
                  </div>
                  <div slot="remark" slot-scope="text, record">
                    <a-input
                      v-model="record.remark"
                      :disabled="completeFlag"
                      v-if="record.score == 0"
                      placeholder="请输入审查原因"
                    />
                  </div>
                </a-table>
              </a-col>
            </template>
          </a-row>
        </a-card>
      </a-col>
      <PingBiaoExpertRecord ref="expertRecordRef" @refresh="changeStep(currentItem.index)" />
      <PingBiaoExpertRecordDetail
        ref="expertRecordDetailRef"
        :currentItem="currentItem"
        :sectionId="sectionId"
        :tenderList="tenderListData"
        :columns="columns"
        :reviewItemList="reviewItemList"
        @refresh="changeStep(currentItem.index)"
      />

      <PfPingBiaoExpertRecordDetail
        ref="pfExpertRecordDetailRef"
        :currentItem="currentItem"
        :tenderId="selectTenderId"
        :realBusinessId="currentItem.businessId"
      />
      <ExTbcompanyScoreList ref="scoreListRef" @confirm="pingbiaoCompleteConfirmOk" />
    </a-row>
    <a-modal
      title="汇总完成"
      :visible="visibleSummarySubmit"
      :confirm-loading="confirmLoading"
      @ok="handleSummaryOk"
      @cancel="handleSummaryCancel"
    >
      <div>
        <a-textarea v-model="summaryContent" placeholder="请输入汇总内容" :auto-size="{ minRows: 3, maxRows: 5 }" />
      </div>
    </a-modal>
    <RollBackModal ref="rollBackModalRef" @ok="refresh(sectionInfo)" />
  </a-spin>
</template>
<script>
import Score from '@/views/exPingbiao/review/Score'
import { getAction, postAction, getFileAccessHttpUrl } from '@api/manage'
import Add from '@views/exZbwj/ScoreChapter/Add'
import StandardList from './review/StandardList'
import PingBiaoExpertRecord from './review/PingBiaoExpertRecord'
import PingBiaoExpertRecordDetail from './review/PingBiaoExpertRecordDetail'
import PfPingBiaoExpertRecordDetail from './review/PfPingBiaoExpertRecordDetail'
import ExTbcompanyScoreList from '@views/exPingbiao/ExTbcompanyScoreList'
import PfTenderDetail from './result/PfTenderDetail'
import FhxExpertDetail from '@views/exPingbiao/result/FhxExpertDetail'
import RollBackModal from './review/RollBackModal'
import ExpertProgressTable from './exBidEvaluation/ExpertProgressList.vue'
import { mapGetters } from 'vuex'

export default {
  components: {
    Add,
    StandardList,
    Score,
    PingBiaoExpertRecord,
    ExTbcompanyScoreList,
    PingBiaoExpertRecordDetail,
    PfPingBiaoExpertRecordDetail,
    FhxExpertDetail,
    PfTenderDetail,
    RollBackModal,
    ExpertProgressTable,
  },
  props: {},
  data() {
    return {
      openKeys: [],
      projectId: null,
      selectedKeys: '',
      activityList: [],
      projectDetail: {},
      sectionInfo: {},
      sectionId: '',
      loading: false,
      loadingGlobal: true,
      url: {
        // 根据项目ID以及标段ID查询详情
        queryByProjectIdAndSectionId:
          '/ExZbwjBidEvaluationConfig/exZbwjBidEvaluationConfig/queryByProjectIdAndSectionId',
        // 根据审查项ID查询审查项列表,
        queryExZbwjConformanceReviewDetailByMainId:
          '/exTenderFile/exZbwjConformanceReview/queryExZbwjConformanceReviewDetailByMainId',
        tenderList: '/exTender/exTenderList/listByBidSectionId',
        savePingBao: '/exPingbiao/exPingbiaoExpert/save',
        // getInfo 参数 ?tenderListId='投标人投标id'&businessType='符合性审查项/评分标准'&businessId=
        getInfo: '/exPingbiao/exPingbiaoExpert/getInfo',
        sectionConfig: '/exPingbiao/exPingbiaoExpert/config',
        changeNext: '/exPingbiao/exPingbiaoExpert/nextBusiness',
        complete: '/exPingbiao/exPingbiaoExpert/complete', //完成评标操作
        summarySubmit: '/exPingbiao/exPingbiaoExpertStageDetail/add', //完成汇总
      },
      currentItem: {
        index: 0,
      },
      // 审查项列表
      reviewItemList: [],
      columns: [
        {
          title: '审查项',
          align: 'center',
          width: 100,
          fixed: 'left',
          dataIndex: 'reviewItem',
        },
        {
          title: '审查标准',
          align: 'center',
          ellipsis: true,
          dataIndex: 'reviewStandard',
        },
        {
          title: '审查结果',
          align: 'center',
          dataIndex: 'action',
          width: 200,
          fixed: 'right',
          scopedSlots: { customRender: 'action' },
        },
        {
          title: '审查备注',
          align: 'center',
          dataIndex: 'remark',
          width: 200,
          fixed: 'right',
          scopedSlots: { customRender: 'remark' },
        },
      ],
      tenderSelectedRowKeys: [],
      tenderListData: [],
      rejectTenderList: [],
      selectTenderId: '', //选中的投标人
      selectTenderName: '',
      groupFlag: false,
      completeFlag: true,
      lastFlag: false,
      configInfo: {}, //
      activeKey: '1',
      sectionDetail: {
        currentItemIndex: 0,
      },
      allCompleted: false, //全部完成
      current: 0,
      stepStyle: {
        marginBottom: '60px',
        boxShadow: '0px -1px 0 0 #e8e8e8 inset',
      },
      visibleSummarySubmit: false,
      confirmLoading: false,
      summaryContent: '',
      cardInfo: {
        cardNo: '',
        cpu: '',
        ip: '',
        mac: '',
        hardDisk: '',
        motherboard: '',
        netCard: '',
      },
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 },
      },
    }
  },

  computed: {
    ...mapGetters(['userInfo']),
    disabledBtn() {
      if (this.currentItem.type == 1) {
        //评分标准
        return false
      }
      return true
    },
  },
  watch: {},
  mounted() {},
  methods: {
    getInfo(chapterId) {
      let params = {
        tenderListId: this.selectTenderId,
        businessType: this.currentItem.type == 1 ? '评分标准' : '符合性审查项',
        businessId: this.currentItem.id,
      }
      getAction(this.url.getInfo, params)
        .then((res) => {
          if (res.success && res.result) {
            let data = res.result
            this.completeFlag = data.completeStatus == '1' || data.completeStatus == '2'
            let exPingbiaoExpertDetailList = data.exPingbiaoExpertDetailList
            if (exPingbiaoExpertDetailList && exPingbiaoExpertDetailList.length > 0) {
              if (this.currentItem.type !== 1) {
                this.reviewItemList.forEach((item) => {
                  let find = exPingbiaoExpertDetailList.find((e) => item.id == e.businessId)
                  if (find) {
                    item.score = find.score
                    item.remark = find.remark
                  }
                })
              }
            }
          } else {
            this.completeFlag = false
          }
        })
        .finally(() => {})
    },
    submit() {
      let params = {
        tenderListId: this.selectTenderId,
        bidSectionId: this.sectionId,
        businessId: this.currentItem.id,
        detailList: [],
      }
      if (this.rejectTenderList.filter((e) => e.id == params.tenderListId).length > 0) {
        this.$message.error('该投标人不符合，不能进行评审')
        return
      }
      let detailList = []
      if (this.currentItem.type == 1) {
        params.businessType = '评分标准'
        let score1Ref = this.$refs['score1Ref']
        let score2Ref = this.$refs['score2Ref']
        let score1Validate = score1Ref.handleSave()
        let score2Validate = score2Ref.handleSave()
        if (!score1Validate || !score2Validate) {
          return
        }
        let chapterRef = score1Ref.$refs.chapterRef
        this.buildDetailList(chapterRef.dataSource, detailList, score1Ref.standardType)
        let chapter2Ref = score2Ref.$refs.chapterRef
        this.buildDetailList(chapter2Ref.dataSource, detailList, chapter2Ref.standardType)
      } else {
        params.businessType = '符合性审查项'
        this.reviewItemList.forEach((item) => {
          let detail = {
            businessId: item.id,
            score: item.score,
            remark: item.remark,
          }
          detailList.push(detail)
        })
        if (detailList.length == 0) {
          this.$message.error('明细不能为空')
          return
        }
        let errorFlag = false
        this.reviewItemList.forEach((item) => {
          if (item.score == null) {
            errorFlag = true
          }
        })
        if (errorFlag) {
          this.$message.error('存在部分审查项未设置，无法提交')
          return
        }
      }
      params.detailList = detailList
      params.realBusinessId = this.currentItem.businessId
      this.loadingGlobal = true
      postAction(this.url.savePingBao, params)
        .then((res) => {
          if (res.success) {
            this.$message.success('保存成功')
            //this.changeStep(this.currentItem.index+1)
            this.completeFlag = true
            this.refresh()
          }
        })
        .finally(() => {
          this.loadingGlobal = false
        })
    },
    buildDetailList(list, detailList, standardType) {
      list.forEach((item) => {
        detailList.push({
          standardType,
          businessId: item.id,
          score: item.scoreValue,
        })
        if (item.children && item.children.length > 0) {
          this.buildDetailList(item.children, detailList, standardType)
        }
      })
    },
    edit(record) {
      this.sectionInfo = Object.assign({}, record)
      this.sectionId = record.id
      this.sectionConfig()
      //this.loadTenderList()
      //this.loadItem(true)//todo 选择人员再加载
    },
    onSelectTender(item) {
      //选中投标人
      this.selectTenderId = item.id
      this.selectTenderName = item.bidderName
      this.cardInfo ={ 
                cardNo: item.cardNo,
                cpu: item.cpu,
                ip: item.ip,
                mac: item.mac,
                hardDisk: item.hardDisk,
                motherboard: item.motherboard,
                netCard: item.netCard,
            }
      this.loadItem()
    },
    loadItem() {
      var that = this
      let params = {
        sectionId: this.sectionId,
      }
      this.loadingGlobal = true
      getAction(this.url.queryByProjectIdAndSectionId, params)
        .then((res) => {
          if (res.success) {
            this.sectionDetail = res.result
            var activeData = res.result.itemList
            that.activityList = []
            let index = 0
            activeData.forEach((item) => {
              item.isSummary = 0
              item.index = index
              index = index + 1
              that.activityList.push(item)
              if (that.groupFlag) {
                let item2 = Object.assign({}, item)
                item2.isSummary = 1
                item2.index = index
                //item2.id = item.id +'汇总';
                // item2.businessId = item.businessId +'汇总';
                item2.businessName = item.businessName + '汇总'
                item2.completeStatus = '0'
                that.activityList.push(item2)
              }
            })
            this.queryExZbwjConformanceReviewDetailByMainId()

            if (!this.configInfo.businessId) {
              this.currentItem = JSON.parse(JSON.stringify(this.activityList[0]))
              this.currentItem.completeStatus = this.configInfo.completeStatus
              this.changeStep(0)
            } else {
              var _isSummary = that.configInfo.groupFlag ? that.configInfo.isSummary : 0
              let findIndex = that.activityList.findIndex(
                (e) => e.id == that.configInfo.businessId && e.isSummary == _isSummary,
              )
              if (findIndex != -1) {
                this.currentItem = JSON.parse(JSON.stringify(this.activityList[findIndex]))
                this.changeStep(findIndex)
              } else {
                this.currentItem = this.activityList[0]
                this.changeStep(0)
              }
            }
          }
        })
        .finally(() => {
          this.loadingGlobal = false
        })
    },
    //投标人列表
    loadTenderList() {
      var that = this
      let params = {
        bidSectionId: that.sectionId,
        realBusinessId: that.currentItem ? that.currentItem.businessId : '',
        decryptStatus: 1,
      }
      that.loading = true
      getAction(this.url.tenderList, params)
        .then((res) => {
          if (res.success) {
            that.rejectTenderList = []
            that.tenderListData = res.result.filter((e) => !e.rejectFlag)
            if (that.tenderListData.length >= 1) {
              var itemObj = that.tenderListData[0];
              that.selectTenderId = that.tenderListData[0].id
              that.selectTenderName = that.tenderListData[0].bidderName
              that.cardInfo ={ 
                  cardNo: itemObj.cardNo,
                  cpu: itemObj.cpu,
                  ip: itemObj.ip,
                  mac: itemObj.mac,
                  hardDisk: itemObj.hardDisk,
                  motherboard: itemObj.motherboard,
                  netCard: itemObj.netCard,
              }
            }
            that.rejectTenderList = res.result.filter((e) => e.rejectFlag)
            that.loadItem() //todo 选择人员再加载
          }
        })
        .finally(() => {
          that.loading = false
        })
    },
    changeStep(index) {
      let item = this.activityList[index]
      this.currentItem = JSON.parse(JSON.stringify(item))
      if (item.type == 1) {
        this.getInfo()
        return
      }
      this.queryExZbwjConformanceReviewDetailByMainId()
    },
    queryExZbwjConformanceReviewDetailByMainId() {
      if (this.currentItem.type == 2) {
        getAction(this.url.queryExZbwjConformanceReviewDetailByMainId, { id: this.currentItem.businessId })
          .then((res) => {
            if (res.success) {
              res.result.forEach((item) => {
                item.score = null
              })
              this.reviewItemList = res.result || []
              this.getInfo()
            }
          })
          .finally(() => {})
      }
    },
    sectionConfig() {
      var that = this
      let params = {
        sectionId: this.sectionId,
      }
      getAction(this.url.sectionConfig, params)
        .then((res) => {
          if (res.success && res.result) {
            let result = res.result
            this.groupFlag = result.groupFlag
            this.lastFlag = result.lastFlag
            this.allCompleted = result.allCompletedFlag
            this.configInfo = Object.assign({}, result)
            this.loadTenderList()
          } else {
            this.currentItem = JSON.parse(JSON.stringify(this.activityList[0]))
          }
        })
        .finally(() => {})
    },
    // 点击跳转下一步
    changeNext() {
      this.loadingGlobal = true
      getAction(this.url.changeNext, { bidSectionId: this.sectionId })
        .then((res) => {
          if (res.success) {
            // this.$message.success('切换成功')
            // if (this.currentItem.index + 1 < this.activityList.length){
            //   this.changeStep(this.currentItem.index + 1)
            // }
            this.refresh()
          }
        })
        .finally(() => {
          this.loadingGlobal = false
        })
    },
    stepStatus(item, index) {
      let currentIndex = this.activityList.findIndex((e) => e.id == this.currentItem.id)
      if (currentIndex != -1) {
        if (index < currentIndex) {
          return 'finish'
        }
        if (index == currentIndex && item.isSummary != this.currentItem.isSummary) {
          return 'finish'
        }
        // if (item.completeStatus == '1') {
        //   return 'finish'
        // }
        // if (this.currentItem.businessId == item.businessId && this.currentItem.isSummary ) {
        //   return 'process'
        // }
      }
      if (this.currentItem.businessId == item.businessId && this.currentItem.isSummary == item.isSummary) {
        return 'process'
      }
      return 'wait'
    },
    showExpertPingBiaoRecord() {
      this.$refs['expertRecordRef'].showModal(this.sectionId, this.selectTenderId)
    },
    showExpertPingBiaoRecordDetail() {
      if (this.currentItem.type == 2) {
        this.$refs['expertRecordDetailRef'].showModal(this.sectionId)
      } else {
        this.$refs['pfExpertRecordDetailRef'].showModal(this.selectTenderId, this.currentItem.businessId)
      }
    },
    showScoreList() {
      this.loadingGlobal = true
      getAction(this.url.complete, { bidSectionId: this.sectionId })
        .then((res) => {
          if (res.success) {
            this.$message.success('操作成功')
            this.$refs['scoreListRef'].show()
          }
        })
        .finally(() => {
          this.loadingGlobal = false
        })
    },
    pingbiaoCompleteConfirmOk() {
      this.$emit('ok')
    },
    showSummarySubmit() {
      this.summaryContent = ''
      this.visibleSummarySubmit = true
    },
    handleSummaryOk() {
      var that = this
      if (that.summaryContent == '') {
        this.$message.error('请填写汇总内容')
        return
      }
      this.loadingGlobal = true
      var param = {
        bidSectionId: this.sectionId,
        businessType: this.currentItem.type,
        businessId: this.currentItem.id,
        summaryContent: that.summaryContent,
      }
      postAction(this.url.summarySubmit, param)
        .then((res) => {
          if (res.success) {
            that.$message.success('操作成功')
            this.handleSummaryCancel()
            that.refresh()
          }
        })
        .finally(() => {
          this.loadingGlobal = false
        })
    },
    handleSummaryCancel() {
      this.visibleSummarySubmit = false
      this.summaryContent = ''
    },
    refresh() {
      //刷新 重新加载
      this.edit(this.sectionInfo)
    },
    downloadFile(text) {
      if (!text) {
        this.$message.warning('未知的文件')
        return
      }
      if (text.indexOf(',') > 0) {
        text = text.substring(0, text.indexOf(','))
      }
      let url = getFileAccessHttpUrl(text)
      window.open(url)
    },
    selectTable(score) {
      this.reviewItemList.forEach((item) => {
        item.score = score
      })
    },
    // 显示回退弹窗
    showRollBackModal() {
      let list = this.activityList
      let find = this.activityList.find(
        (e) => e.id == this.configInfo.businessId && e.isSummary == this.configInfo.isSummary,
      )
      console.log(find)
      console.log(this.activityList)
      if (find) {
        // list = this.activityList.filter(e => (e.index <= find.index && e.id != find.id) || (e.id == find.id && e.isSummary < find.isSummary))
        list = this.activityList.filter((e) => e.index <= find.index && e.isSummary == 0)
      }
      this.$refs['rollBackModalRef'].showModal(this.sectionId, list)
    },
    //
    stepChange(e) {
      let selectedItem = this.activityList[e]
      console.log(selectedItem)
      if (selectedItem.id == this.currentItem.id) {
        if (selectedItem.isSummary === 1) {
          // 选中了汇总节点
          // this.currentItem.isSummary = 1
          this.changeStep(e)
        } else {
          this.currentItem.isSummary = 0
          this.changeStep(e)
        }
        return
      }
      console.log(this.activityList[e])
    },
  },
}
</script>

<style scoped>
/* 新增自定义步骤条样式 */
/deep/ .ant-steps-item-process .ant-steps-item-icon {
  background-color: #fa8c16 !important; /* 进行中节点橙色 */
  border-color: #fa8c16 !important;
}

/deep/ .ant-steps-item-finish .ant-steps-item-icon {
  background-color: #52c41a !important; /* 已完成节点绿色 */
  border-color: #52c41a !important;
}

/deep/ .ant-steps-item-wait .ant-steps-item-icon {
  background-color: #bfbfbf !important; /* 未评审节点灰色 */
  border-color: #bfbfbf !important;
}

/* 文字颜色同步修改 */
/deep/ .ant-steps-item-process > .ant-steps-item-container > .ant-steps-item-content > .ant-steps-item-title {
  color: #fa8c16 !important;
}

/deep/ .ant-steps-item-finish > .ant-steps-item-container > .ant-steps-item-content > .ant-steps-item-title {
  color: #52c41a !important;
}

/deep/ .ant-steps-item-wait > .ant-steps-item-container > .ant-steps-item-content > .ant-steps-item-title {
  color: #bfbfbf !important;
}

/* 原有样式保留 */
.item-container {
  .item {
    height: 40px;
    line-height: 40px;
    cursor: pointer;
    text-align: center;
    font-size: 16px;
  }
}

.selected {
  color: #1890ff;
}
</style>
